3. Shedule Healthcheck

Schedule Healthcheck

In this example, healthcheck scheduling is demonstrated.

  • Turned off printing rss and external memory usage by Node.js
  • Run healthcheck routine with a minute interval.

File : setScheduleHealthCheck.js

const net = require('net');
const debug = require('pretty-debug');

debug.info('Example : Set Schedule');

function healthcheck(){
	debug.memoryWatermark();
	debug.sysMemoryMonitor();
	debug.nodeMemoryMonitor();
}

debug.scheduleHealthCheck(healthcheck, 1);

Run Example

To run the above example simply run the command below

$ node setScheduleHealthCheck.js

Output

Output

-----------------------------------------------------